﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>中文日期样式(二)</title>
    <script type="text/javascript">
        document.write("<center><font size=+1><b>") //设置在文档中的显示样式
        today = new Date()                          //定义新的日期对象
        document.write("<center><small>")           //根据getDay方法，判断是星期几
        if (today.getDay() == 5) document.write("星期五")
        if (today.getDay() == 6) document.write("星期六")
        if (today.getDay() == 0) document.write("星期日")
        if (today.getDay() == 1) document.write("星期一")
        if (today.getDay() == 2) document.write("星期二")
        if (today.getDay() == 3) document.write("星期三")
        if (today.getDay() == 4) document.write("星期四")
        document.write("</small></center>")
    </script>
</head>
<body>

</body>
</html>